﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChangePassword.aspx.cs" Inherits="AntiObesity.Services.ChangePassword" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server"><title>Change password</title>
<link href="css/reset.css" rel="stylesheet" type="text/css" />
<script src="Contents/jquery.js" type="text/javascript"></script>
<script src="Contents/jquery-ui.js" type="text/javascript"></script>
<script src="Contents/jquery-validate.js" type="text/javascript"></script>
<script src="Contents/jquery.en-GB.js" type="text/javascript"></script>
<link href="Contents/css/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <span class="change-password">
        <h1>
            Change your Password</h1>
        <span class="form">
            <span class="items-body">
                <span class="item">
                    <span class="label">
                        <label for="txtPassword">Password:</label>
                    </span>
                    <span class="input">
                        <asp:TextBox class="required" ID="txtPassword" runat="server" TextMode="Password" Width="200"></asp:TextBox>
                    </span>
                </span>
                <span class="item">
                    <span class="label">
                        <label for="txtPasswordAgain">Retype Password:</label>
                    </span>
                    <span class="input">
                        <asp:TextBox class="required" ID="txtPasswordAgain" runat="server" TextMode="Password" Width="200"></asp:TextBox>
                    </span>
                </span>
            </span>
            <span class="buttons">
                <asp:Button Text="Change" ID="btnChange" runat="server" OnClick="btnChange_Click" />
                <a href="UserHome.aspx">Return to Home Page</a> 
        </span>
    </span>
    </form>
    <script language="javascript" type="text/javascript">
        $(document).ready(function() {

            var validator = $("form").validate({
                rules: {
                    txtPasswordAgain: {
                        equalTo: '#txtPassword'
                    }
                },
                messages: {
                    txtPasswordAgain: {
                        equalTo: "passwords does not match"
                    }
                },
                errorPlacement: function(error, element) {
                    if (element.hasClass('hasDatepicker'))
                        error.insertAfter(element.next());
                    else {
                        var info = element.parent().parent().children('.info');
                        if (info.hasClass('info'))
                            error.insertAfter(info);
                        else
                            error.insertAfter(element);
                    }
                }
            });

        });
    </script></body>
</html>
